import request from '@/utils/request'

export function createWorkOrderFilterMenu(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/createWorkOrderFilterMenu',
    method: 'post',
    data: params
  })
}

export function createWorkOrderFilterMenus(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/createWorkOrderFilterMenus',
    method: 'get',
    data: params
  })
}

export function deleteFilterMenu(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/deleteFilterMenu?id=' + id,
    method: 'delete'
  })
}

export function selectAll(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/selectAll?currentPage=' + params.currentPage + '&pageSize=' + params.pageSize,
    method: 'get'
  })
}

export function selectById(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/selectById?id=' + id,
    method: 'get'
  })
}
export function selectByNameAndOrderTypeName(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/selectByNameAndOrderTypeName',
    method: 'post',
    data: params
  })
}

export function selectOrder() {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/selectOrder',
    method: 'get'
  })
}

export function updateContent(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/updateContent',
    method: 'post',
    data: params
  })
}

export function updateUseStatus(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/updateUseStatus?id=' + params.id + '&userId=' + params.userId + '&status=' + params.status,
    method: 'get'
  })
}

// export function selectAllNewable(id) {
//     return request({
//         url: window.CONFIG.workOrderRestIp + '/workOrderType/selectAllNewable?userId=' + id,
//         method: 'get'
//     })
// }

export function selectAllSelectable() {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderType/selectAllSelectable',
    method: 'get'
  })
}
export function selectAllCondition() {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/selectAllCondition',
    method: 'get'
  })
}

export function selectSecondCondition(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/selectSecondCondition?id=' + id,
    method: 'get'
  })
}
export function selectThirdCondition(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/selectThirdCondition',
    method: 'post',
    data: params
  })
}
export function selectThirdConditionForCurrentUser(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderFilterMenu/selectThirdConditionForCurrentUser',
    method: 'post',
    data: params
  })
}
